#include<iostream>
#include"matrix.h"
/**
 * @file   main.cpp
 * @author yyh
 * @date   Thu Oct  7  2021
 * 
 * @brief  matrix头文件的测试文件，测试isSquare（）函数，以及四种不同的运算
 * 
 * 
 */



int main()
{
    int m,n;
    //测试 isSquare();
    std::cin>>m;
    std::cin>>n;
    //创造矩阵 a,b,c,d
    Matrix<double> a(m,n);
    std::cin>>m;
    std::cin>>n;
    Matrix<double> b(m,n);
    std::cin>>m;
    std::cin>>n;
    Matrix<double> c(m,n);
    std::cin>>m;
    std::cin>>n;
    Matrix<double> d(m,n);
    if(a.is_square())
	std::cout<<"a is square"<<std::endl;
    else
	std::cout<<"a isn't square"<<std::endl;
    if(b.is_square())
	std::cout<<"b is square"<<std::endl;
    else
	std::cout<<"b isn't square"<<std::endl;
    //测试矩阵乘法
    Matrix<double> tes1;
    tes1=a*b;
    tes1.print();
    //测试向量乘法
    std::cin>>n;
    ColVector<double> e(n);
    ColVector<double> f(n);
    int test;
    test = e*f;
    std::cout<<"the test is "<<test<<std::endl;
    
    std::cin>>n;
    RowVector<double> R1(n);
    RowVector<double> R2(n);
    test = R1*R2;
    std::cout<<"the row test result is "<<test<<std::endl;

    
    std::cout<<"the row and col result is "<<R1*f<<std::endl;
    
    tes1=f*R1;
    std::cout<<"the col and row test result is"<<std::endl;
    tes1.print();
    return 0;
}
